<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="/admins/js/jquery/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.PrintArea.js"></script> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
        body{font:12px/1.5 Tahoma,Helvetica,Arial,'\5b8b\4f53',sans-serif;height:100%;}html{overflow-y:scroll}body, dl, dt, dd, ul, ol, li,h1, h2, h3, h4, h5, h6,form, fieldset,legend, input, button,textarea, p,th, td ,figure{margin:0;padding:0}article, aside, figcaption, figure,footer, header, hgroup, nav, section{display:block}table{border-collapse:collapse;border-spacing:0}caption,th{text-align:left}fieldset, img{border:0}ol, ul{list-style:none}h1, h2, h3, h4, h5, h6{font-size:100%;font-weight:normal}address,caption,cite,em,strong,th,i{font-style:normal;font-weight:normal}abbr, acronym{border:0;font-variant:normal}input,select{vertical-align:middle}a{color:#333;text-decoration:none;}
        qudaocaozuo{padding-left:120px;height:40px;padding-top:15px;}
        .anvbotton{float:left;background:url(/admins/images/global-button.gif) no-repeat 0 0;height:35px;color:#fff;font-family:"Microsoft YaHei","simsun";font-size:16px;line-height:35px;}
        .anvbotton span{background:url(/admins/images/global-button.gif) no-repeat right -177px;height:35px;float:left;padding:0 25px;cursor:pointer;}
        .anvbotton:hover{background-position:0 -45px;color:#fff;}
        .anvbotton:hover span{background-position: right -222px;}

        .anvbotton4{float:left;background:url(/admins/images/global-button.gif) no-repeat 0 -89px;height:35px;color:#666;font-family:"Microsoft YaHei","simsun";font-size:16px;line-height:35px;}
        .anvbotton4 span{background:url(/admins/images/global-button.gif) no-repeat right -266px;height:35px;float:left;padding:0 25px;cursor:pointer;}
        .anvbotton4:hover{background-position:0 -133px;color:#333;}
        .anvbotton4:hover span{background-position: right -310px;}
        .yundancaozuo li{float:left;padding-right:10px;}
        .yundancaozuo a{float:left;background:url(/admins/images/global-button.gif) no-repeat 0 -89px;height:35px;color:#666;font-family:"Microsoft YaHei","simsun";font-size:16px;line-height:35px;}
        .yundancaozuo a span{background:url(/admins/images/global-button.gif) no-repeat right -266px;height:35px;float:left;padding:0 25px;cursor:pointer;}
        .yundancaozuo a:hover{background-position:0 -133px;color:#333;}
        .yundancaozuo a:hover span{background-position: right -310px;}
        .yundancaozuo .jscz a{background:url(/admins/images/global-button.gif) no-repeat 0 0;color:#fff;}
        .yundancaozuo .jscz a span{background:url(/admins/images/global-button.gif) no-repeat right -177px;}
        .yundancaozuo .jscz a:hover{background-position:0 -45px;}
        .yundancaozuo .jscz a:hover span{background-position: right -222px;}
        .fapiaoleft{width:800px;background:#fff;float:left;margin-right:20px;display:inline;padding-right:20px;}
        .bjfp h1{text-align:center;font-size:25px;font-family: "Times New Roman", Times, serif;font-weight:bold;}
        .fptable td{padding:10px 0;}
        .fp1{border-bottom:#333 solid 1px;}
        .fp2{border-bottom:#333 solid 1px;height:40px;}
        .fp3{border-bottom:#333 solid 1px;height:40px;}
        .fp4{border-bottom:#333 solid 1px;height:160px;vertical-align:top;}
        .fp5{border-bottom:#333 solid 1px;height:60px;vertical-align:top;}
        .fp6{border-bottom:#333 solid 1px;height:60px;vertical-align:top;}
        .fp7{border-bottom:#333 solid 1px;height:60px;text-align:center;}
        .fp8{border-bottom:#333 solid 1px;border-top:#333 solid 1px;height:60px;text-align:center;}
        .fp9{height:40px;text-align:center;}
        .fp10{height:60px;}

        .fptable h2{font-family: "Times New Roman", Times, serif;font-weight:bold;}
        .fptable{width:800px;}
        .fptable table{width:800px;}
        .rightline{border-right:#333 solid 1px;}
        .dyg_jg{border-bottom:#333 solid 1px;}
        .dyg_qm{}

        .fapiaoright{float:left;width:602px;}
        .pleft{padding-left:10px;}

        .fpdizhi{padding-top:10px;}
        .fpdizhi li span{text-decoration:underline;padding-left:5px;}
        .fpdizhi p{line-height:20px;}
        .fpdizhi p span{text-decoration:underline;padding-left:5px;}
        .fptable h3{padding:5px 0 5px 10px;}
        .inputwu{border:0;padding:5px 10px;color:#c00;font-size:12px;}
        .textareawu{border:0;padding:5px 10px;overflow:hidden;width:355px;height:30px;color:#c00;font-size:12px;font-family:Arial, Helvetica, sans-serif;}
        .fpdizhi .inputwu{padding:0 5px;text-decoration:underline;float:left;}
        .fpdizhi label{float:left;}
        .fpdizhi li{height:20px;padding-left:10px;}
        .fapiao_cz{padding-top:20px;height:70px;border-top:#ddd solid 2px;margin-top:30px;}
        .fapiao_cz a{margin-right:10px;}

        .qdmcs{font-size:24px;height:57px;font-family:"Microsoft yahei","simsun";line-height:50px;border-bottom:#333 solid 1px;margin-bottom:20px;color:#6C6;}
        .qdcc .qdtop{width:600px;}
        .qdcc .qdtop th{background:#fff;}
        .qdcc .qdtop table{width:600px;}
        .qdcc .tabletd{width:600px;}
        .qdcc .tabletd table{width:600px;}
        .qdcc .qd1{width:100px;}
        .qdcc .qd3{width:55px;}
        .qdcc .qd4{width:55px;}
        .qdcc .qdbeizhu{margin-left:120px;}
        .fapiaoyulan{width:800px;margin:auto;}
        .fpxuxian{border-bottom:#ddd dashed 1px;}
    </style>
<body>
<div class="fapiaoyulan" >
    <div class="fptable" id="prinboby" >
        <style media="print">
            body{
                 -webkit-print-color-adjust: exact;
            }
            body{font:12px/1.5 Tahoma,Helvetica,Arial,'\5b8b\4f53',sans-serif;height:100%;}html{overflow-y:scroll}body, dl, dt, dd, ul, ol, li,h1, h2, h3, h4, h5, h6,form, fieldset,legend, input, button,textarea, p,th, td ,figure{margin:0;padding:0}article, aside, figcaption, figure,footer, header, hgroup, nav, section{display:block}table{border-collapse:collapse;border-spacing:0}caption,th{text-align:left}fieldset, img{border:0}ol, ul{list-style:none}h1, h2, h3, h4, h5, h6{font-size:100%;font-weight:normal}address,caption,cite,em,strong,th,i{font-style:normal;font-weight:normal}abbr, acronym{border:0;font-variant:normal}input,select{vertical-align:middle}a{color:#333;text-decoration:none;}
            
            .yundancaozuo .jscz a:hover{background-position:0 -45px;}
            .yundancaozuo .jscz a:hover span{background-position: right -222px;}
            .fapiaoleft{width:800px;background:#fff;float:left;margin-right:20px;display:inline;padding-right:20px;}
            .bjfp h1{text-align:center;font-size:25px;font-family: "Times New Roman", Times, serif;font-weight:bold;}
            .fptable td{padding:10px 0;}
            .fp1{border-bottom:#333 solid 1px;}
            .fp2{border-bottom:#333 solid 1px;height:40px;}
            .fp3{border-bottom:#333 solid 1px;height:40px;}
            .fp4{border-bottom:#333 solid 1px;height:160px;vertical-align:top;}
            .fp5{border-bottom:#333 solid 1px;height:60px;vertical-align:top;}
            .fp6{border-bottom:#333 solid 1px;height:60px;vertical-align:top;}
            .fp7{border-bottom:#333 solid 1px;height:60px;text-align:center;}
            .fp8{border-bottom:#333 solid 1px;border-top:#333 solid 1px;height:60px;text-align:center;}
            .fp9{height:40px;text-align:center;}
            .fp10{height:60px;}

            .fptable h2{font-family: "Times New Roman", Times, serif;font-weight:bold;}
            .fptable{width:800px;}
            .fptable table{width:800px;}
            .rightline{border-right:#333 solid 1px;}
            .dyg_jg{border-bottom:#333 solid 1px;}
            .dyg_qm{}

            .fapiaoright{float:left;width:602px;}
            .pleft{padding-left:10px;}

            .fpdizhi{padding-top:10px;}
            .fpdizhi li span{text-decoration:underline;padding-left:5px;}
            .fpdizhi p{line-height:20px;}
            .fpdizhi p span{text-decoration:underline;padding-left:5px;}
            .fptable h3{padding:5px 0 5px 10px;}
            .inputwu{border:0;padding:5px 10px;color:#c00;font-size:12px;}
            .textareawu{border:0;padding:5px 10px;overflow:hidden;width:355px;height:30px;color:#c00;font-size:12px;font-family:Arial, Helvetica, sans-serif;}
            .fpdizhi .inputwu{padding:0 5px;text-decoration:underline;float:left;}
            .fpdizhi label{float:left;}
            .fpdizhi li{height:20px;padding-left:10px;}
            .fapiao_cz{padding-top:20px;height:70px;border-top:#ddd solid 2px;margin-top:30px;}
            .fapiao_cz a{margin-right:10px;}

            .qdmcs{font-size:24px;height:57px;font-family:"Microsoft yahei","simsun";line-height:50px;border-bottom:#333 solid 1px;margin-bottom:20px;color:#6C6;}
            .qdcc .qdtop{width:600px;}
            .qdcc .qdtop th{background:#fff;}
            .qdcc .qdtop table{width:600px;}
            .qdcc .tabletd{width:600px;}
            .qdcc .tabletd table{width:600px;}
            .qdcc .qd1{width:100px;}
            .qdcc .qd3{width:55px;}
            .qdcc .qd4{width:55px;}
            .qdcc .qdbeizhu{margin-left:120px;}
            .fapiaoyulan{width:800px;margin:auto;}
            .fpxuxian{border-bottom:#ddd dashed 1px;}
        </style>        
      <table style="width: 800px;font: 12px/1.5 Tahoma,Helvetica,Arial,'宋体b8b\4f53',sans-serif;">
            <tr class="fp1">
                <td class="bjfp" colspan="10"><h1>COMMERCIAL INVOICE</h1></td>
            </tr>
            <tr class="fp2">
              <td class="rightline" colspan="3"><h2>INTERNATIONAL AIR WAYBILL NO.</h2></td>
                <td colspan="7">　EORI： <?php echo $this->invoiceall?$this->invoiceall->waybillno:"";?></td>
            </tr>
            <tr class="fp3">
              <td class="rightline" colspan="3"><h2>DATE OF EXPORTATION</h2></td>
              <td class="rightline" colspan="2"><h3><?php echo $this->invoiceall?$this->invoiceall->orderdate:date('Y-m-d');?></h3></td>
              <td class="rightline" colspan="3"><h2 class="pleft">INVOICE NO.</h2></td>
                <td colspan="2"><h3><?php echo $this->invoiceall?$this->invoiceall->invoiceno:$this->billall->user->storeno."-".date('Ymd');?></h3></td>
            </tr>
            <tr class="fp4">
                <td class="rightline fpw400" colspan="5">
                    <h2>FROM (Shipper)</h2>
                    <div class="fpdizhi">
                        <p>Building 2 YouQi warehouse ShanCheng logistics park Tangtou  avenue  Shiyan street<br>Baoan District, SHENZHEN<br>GUANGDONG CHINA</p>
                        <p>Tel:<span>0755-88605979</span></p>
                        <p>Contact:<span>TING YAN</span></p>
                    </div>
                </td>
                <td class="fpw400" colspan="5">
                    <h2 class="pleft">TO (Receiver)</h2>
                    <div class="fpdizhi">
                        <h3><?php echo $this->invoiceall?$this->invoiceall->address:$this->billall->conAdd;?></h3>
                        <ul>
                            <li><label>Zip code:</label><span><?php echo $this->invoiceall?$this->invoiceall->zipcode:$this->billall->conPostCode;?></span></li>
                            <li><label>Tel:</label><span><?php echo $this->invoiceall?$this->invoiceall->tel:$this->billall->conTel;?></span></li>
                            <li><label>Contact:</label><span><?php echo $this->invoiceall?$this->invoiceall->attn:$this->billall->consignee;?></span></li>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr class="fp5">
                <td class="rightline" colspan="5">
                    <h2>COUNTRY OF EXPORT</h2>
                    <h3>China </h3>
                </td>
                <td colspan="5">
                    <h2 class="pleft">COUNTRY OF ULTIMATE DESTINATION</h2>
                    <h3><?php echo $this->invoiceall?$this->invoiceall->country:$this->billall->UserCity->ename."(".$this->billall->UserCity->name.")";?></h3>
                </td>
            </tr>
            <tr class="fp6">
                <td class="rightline" colspan="5">
                    <h2>REASON FOR EXPORT (e.g. personal gift, return for repair)</h2>
                    <h3><?php echo $this->invoiceall?$this->invoiceall->reason:"";?></h3>
                </td>
                <td colspan="5">
                    <h2 class="pleft">WEIGHT</h2>
                    <h3><?php echo $this->invoiceall?($this->invoiceall->weight=="0.00"?"":$this->invoiceall->weight."kg"):"";?></h3>
                </td>
            </tr>
            <tr class="fp7">
                <td class="rightline"><h2>NO. OF<br />
                PKGS</h2></td>
              <td class="rightline" colspan="3"><h2>DESCRIPTION OF GOODS</h2></td>
              <td class="rightline"><h2>HS CODE</h2></td>
              <td class="rightline" colspan="2"><h2>QTY</h2></td>
              <td class="rightline" colspan="2"><h2>UNIT VALUE<br />
                USD</h2></td>
                <td><h2>TOTAL<br />
                VALUE</h2></td>
            </tr>
            <?php if($this->invoicedetail){
                foreach($this->invoicedetail as $key => $valItem){ ?>
                    <tr>
                        <td align="center"><p><?php echo $valItem->pkgs>0?$valItem->pkgs:""; ?></p></td>
                        <td colspan="3" align="center"><p><?php echo $valItem->description; ?></p></td>
                        <td align="center"><p><?php echo $valItem->hscode; ?></p></td>
                        <td colspan="2" align="center"><p><?php echo $valItem->num; ?></p></td>
                        <td colspan="2" align="center"><p><?php echo $valItem->price; ?></p></td>
                        <td align="center"><p><?php echo $valItem->total; ?></p></td>
                    </tr>
            <?php }}?>
        
            <tr class="fp8">
                <td colspan="9"></td>
                <td><h2>TOTAL INVOICE<br />
                VALUE</h2></td>
            </tr>
            <tr class="fp9">
                <td colspan="9">&nbsp;</td>
                <td class="dyg_jg"><p><?php echo $this->invoiceall?$this->invoiceall->total:0;?>(USD)</p></td>
            </tr>
            <tr class="fp10">
                <td colspan="10"><h2>I DECLARE ALL THE INFORMATION CONTAINED IN THE INVOICE TO BE TRUE AND CORRECT.</h2></td>
            </tr>
            <tr>
                <td class="dyg_qm" colspan="4"><h2>SIGNATURE OF SHIPPER / EXPORTER</h2></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td align="center"><h2>DATE</h2></td>
            </tr>
            <tr>
                <td width="70" class="dyg_jg">TING YAN</td>
                <td width="80"></td>
                <td width="80"></td>
                <td width="80"></td>
                <td width="110"></td>
                <td width="60"></td>
                <td width="60"></td>
                <td width="60"></td>
                <td width="80"></td>
                <td class="dyg_jg" align="center"><p><?php echo $this->invoiceall?$this->invoiceall->orderdate:date('Y-m-d');?></p></td>
            </tr>
      </table>
  </div>
    <?php if($this->download != 1){?>
    <div class="fapiao_cz" id="div_button">
        <ul>
            <li><a href="javascript:void(0)" class="anvbotton4" id="print"><span>打印</span></a></li>
            <li><a href="/admini/managewaybill/invoice/id/<?php echo $this->billall->id;?>" class="anvbotton4"><span>编辑</span></a></li>
            <li><a href="/admini/managewaybill/invoice/ma/5/id/<?php echo $this->billall->id;?>" class="anvbotton4"><span>返回运单</span></a></li>
            <li><a href="/admini/managewaybill/printexcel/id/<?php echo $this->billall->id;?>" class="anvbotton4" id="download"><span>下载Excel</span></a></li>
            <li><a href="/admini/managewaybill/preview/download/1/id/<?php echo $this->billall->id;?>" class="anvbotton4" id="download"><span>下载Html</span></a></li>
        </ul>
    </div>
    <?php }?>
</div>
</body>
<script type="text/javascript">
    <?php if($this->ma==3){?>
        $(document).ready(function(){
            $("div#prinboby").printArea(); 
            window.close();
        });
    <?php }?>
    $("#div_button #print").click(function(){
         $("div#prinboby").printArea(); 
    });
</script>